END {
    srand();
    outfile="user_log.ctl";
    printf("load data\ninfile *\nappend\ninto table user_log\nfields terminated by '|'\n(\n\tlog_id\t\tinteger external,\n\tcreate_ts\tdate(14) 'YYYYMMDDHH24MISS',\n\tlog_dt\t\tchar(8),\n\tloginname\tchar(12),\n\tcontent\t\tchar(300)\n)\nbegindata\n") > outfile;
    seq=1;
    for(day=1; day<=15; day++)
    {
        for(count=0; count<200000; count++)
        {
            printf("%07d|20010101000000|200101%02d|test%04d|Hard work and no play makes Jack a dull boy\n", seq, day, int(rand()*10000)) >> outfile;
                seq++;
        }
    }

    outfile="user_log_partition.ctl";
    printf("load data\ninfile *\nappend\ninto table user_log_partition\nfields terminated by '|'\n(\n\tlog_id\t\tinteger external,\n\tcreate_ts\tdate(14) 'YYYYMMDDHH24MISS',\n\tlog_dt\t\tchar(8),\n\tloginname\tchar(12),\n\tcontent\t\tchar(300)\n)\nbegindata\n") > outfile;
    seq=1;
    for(day=1; day<=15; day++)
    {
        for(count=0; count<200000; count++)
        {
            printf("%07d|20010101000000|200101%02d|test%04d|Hard work and no play makes Jack a dull boy\n", seq, day, int(rand()*10000)) >> outfile;
                seq++;
        }
    }

    for(day=1; day<=15; day++)
    {
        outfile=sprintf("user_log_200101%02d.ctl", day);
        printf("load data\ninfile *\nappend\ninto table user_log_200101%02d\nfields terminated by '|'\n(\n\tlog_id\t\tinteger external,\n\tcreate_ts\tdate(14) 'YYYYMMDDHH24MISS',\n\tloginname\tchar(12),\n\tcontent\t\tchar(300)\n)\nbegindata\n", day) > outfile;
        seq=1;
        for(count=0; count<200000; count++)
        {
            printf("%07d|20010101000000|test%04d|Hard work and no play makes Jack a dull boy\n", seq, int(rand()*10000)) >> outfile;
            seq++;
        }
    }
}
